package com.vito.dcs.sys.deviceSet.service.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.vito.base.factory.IDFactory;
import com.vito.dcs.sys.deviceSet.dao.DeviceSetMapper;
import com.vito.dcs.sys.deviceSet.model.DeviceSetModel;
import com.vito.dcs.sys.deviceSet.service.DeviceSetService;

@Service
public class DeviceSetServiceImpl implements DeviceSetService{

	@Autowired
	private DeviceSetMapper deviceSetMapper;
	
	@Override
	public void saveDeviceSet(DeviceSetModel deviceSetModel) {
		String id = IDFactory.getIDFactory().getIdInc("tbl_dcs_sys_device_set")+"";
		deviceSetModel.setId(id);
		deviceSetMapper.deleteDeviceSet(deviceSetModel);
		deviceSetMapper.saveDeviceSet(deviceSetModel);
	}

	@Override
	public void deleteDeviceSet(DeviceSetModel deviceSetModel) {
		deviceSetMapper.deleteDeviceSet(deviceSetModel);
	}

	@Override
	public DeviceSetModel queryDeviceSetBySectionId(DeviceSetModel deviceSetModel) {
		return deviceSetMapper.queryDeviceSetBySectionId(deviceSetModel);
	}

}
